﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace SystemHYS.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class change : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "GualityGroups",
                columns: table => new
                {
                    gualityGroupId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    gualityGroupName = table.Column<string>(type: "text", nullable: true),
                    gualityGroupNumbering = table.Column<string>(type: "text", nullable: true),
                    gualityGroupRemark = table.Column<string>(type: "text", nullable: true),
                    IsDel = table.Column<bool>(type: "boolean", nullable: true),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GualityGroups", x => x.gualityGroupId);
                });

            migrationBuilder.CreateTable(
                name: "GualityProjects",
                columns: table => new
                {
                    gualityProjectId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    gualityProjectName = table.Column<string>(type: "text", nullable: true),
                    gualityProjectNumbering = table.Column<string>(type: "text", nullable: true),
                    gualityProjectTool = table.Column<string>(type: "text", nullable: true),
                    gualityProjectMethod = table.Column<string>(type: "text", nullable: true),
                    gualityProjectType = table.Column<string>(type: "text", nullable: true),
                    gualityProjectStandardValue = table.Column<string>(type: "text", nullable: true),
                    gualityProjectRemark = table.Column<string>(type: "text", nullable: true),
                    gualityProjectAboveDifference = table.Column<int>(type: "integer", nullable: false),
                    gualityProjectUnderDifference = table.Column<int>(type: "integer", nullable: false),
                    IsDel = table.Column<bool>(type: "boolean", nullable: true),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GualityProjects", x => x.gualityProjectId);
                });

            migrationBuilder.CreateTable(
                name: "GualitySchemes",
                columns: table => new
                {
                    gualitySchemeId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    gualitySchemeNumbering = table.Column<string>(type: "text", nullable: true),
                    gualitySchemeName = table.Column<string>(type: "text", nullable: true),
                    gualitySchemeState = table.Column<string>(type: "text", nullable: true),
                    gualityGroupId = table.Column<int>(type: "integer", nullable: false),
                    IsDel = table.Column<bool>(type: "boolean", nullable: true),
                    state = table.Column<bool>(type: "boolean", nullable: true),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GualitySchemes", x => x.gualitySchemeId);
                });

            migrationBuilder.CreateTable(
                name: "ProjectScheme",
                columns: table => new
                {
                    ProjectSchemeId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    gualityProjectId = table.Column<int>(type: "integer", nullable: false),
                    gualitySchemeId = table.Column<int>(type: "integer", nullable: false),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProjectScheme", x => x.ProjectSchemeId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "GualityGroups");

            migrationBuilder.DropTable(
                name: "GualityProjects");

            migrationBuilder.DropTable(
                name: "GualitySchemes");

            migrationBuilder.DropTable(
                name: "ProjectScheme");
        }
    }
}
